class Solution(object):
    def minDeletionSize(self, strs):
        """
        :type strs: List[str]
        :rtype: int
        """
        m = len(strs)
        n = len(strs[0])
        count = 0
        for j in range(n):
            for i in range(1, m):
                if strs[i][j] < strs[i - 1][j]:
                    count += 1
                    break
        return count


data = Solution()
strs = ["abc", "bce", "cae"]
print(data.minDeletionSize(strs))
